import 'package:aihu_getx_app/app/modules/commons/commons.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../controllers/d_workbench_controller.dart';

class DWorkbenchView extends GetView<DWorkbenchController> {
  const DWorkbenchView({super.key});

  @override
  Widget build(BuildContext context) {
    return Obx(
      () => Scaffold(
        key: controller.scaffoldKey,
        appBar: Commons.appBar(
          title: controller.title,
          subTitle: controller.appName.value,
          actions: [
            IconButton(
              onPressed: () {
                controller.openDrawer();
              },
              icon: const Icon(Icons.menu),
            ),
          ],
        ),
        drawer: Drawer(
          child: SafeArea(
            minimum: const EdgeInsets.all(10),
            child: ListView(
              padding: const EdgeInsets.all(0),
              children: controller.menuList(),
            ),
          ),
        ),
        body: const Center(
          child: Text(
            'DWorkbenchView is working',
            style: TextStyle(fontSize: 20),
          ),
        ),
      ),
    );
  }
}
